<script>
    function checkLength(obj){
        var length = obj.val().length;
        $("#length").text(100-length);
        
    }
    function recommendShopsSub(){
        var name = $("input[name=apply_name]").val();
        if(name == ''){
            showTip('系统提示'," 请输入餐厅名称！",'2',1.5,'#apply_name');
            return false;
        }
        var phone = $("input[name=apply_phone]").val();
        if(phone == '能记住餐厅电话对我们更有帮助哦'){
            phone = '';
        }
        var addr = $("textarea[name=apply_addr]").val();
        if(addr == '可以告诉我们餐厅的地址吗'){
            addr = '';
        }
        $.post("{:U('Ajax/recommendShopsSub')}",{
            name:name,
            phone:phone,
            addr:addr
        },function(data){
            closebgbox('#mainbox')
            showTip('系统提示'," 感谢您提交新的餐厅，我们会尽快处理！",'2');
            return false;
        })
    }
</script>
<div class='browsebox' id='browsebox' style='width:475px;'>
    <div class='head' id='headbox'>
        <a class='close' onclick=closebgbox('#mainbox')></a>
        <span id='title'>推荐新餐厅</span>
    </div>
    <div class='boxcontent' style='padding:0'>
        <div class='clear_cart_inner'>
            <div class='cf_con'>
                <div id=feedbackTip>
                    <p class='apply_tip'>此处仅限用户申请开通餐厅,餐厅请到<a href="{:U('News/join')}">餐厅加盟</a>提交</p>
                    <table width=100% class='tableBox'>
                        <tr>
                            <td width="80px" align="right"><label>*餐厅名称：</label></td>
                            <td>
                                <input type='text' name='apply_name' id="apply_name" autocomplete="off" >
                                <span class='remark' style="margin-left: 2px;">请输入餐厅名称</span>
                            </td>
                        </tr>
                        <tr>
                            <td align="right"><label>餐厅电话：</label></td>
                            <td><input type='text' name='apply_phone' value="能记住餐厅电话对我们更有帮助哦" onclick="clickInput($(this),'能记住餐厅电话对我们更有帮助哦')">
                            </td>
                        </tr>
                        <tr>
                            <td align="right"><label>餐厅地址：</label></td>
                            <td>
                                <textarea name='apply_addr' style='width:200px ' maxlength="100"
                                          onclick="clickInput($(this),'可以告诉我们餐厅的地址吗')"
                                          onkeyup="checkLength($(this))">可以告诉我们餐厅的地址吗</textarea>
                                <span class='remark'>还可以输入<strong class="red" id="length">100</strong>个汉字</span>
                            </td>
                        </tr>
                    </table>
                </div>
                <div class='do_clear_cart clearfix' style='padding:16px 0 0 0;background:none'>
                    <a class='do_not_clear' onclick=recommendShopsSub()>确认</a><a class='do_clear'  onclick=closebgbox('#mainbox')>取消</a>
                </div>
            </div>
        </div>
    </div>
</div>